﻿using BwTMusicModels;
using HwjUIDI.Utility.DatabaseHelper;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BwTMusicServices.Genre
{
    public class GenreServices
    {
        public List<North_Genre> GetGenreList()
        {
            List<North_Genre> genres = new List<North_Genre>();
            try
            {
                string sql = "select * from North_Genre";
                using (SqlDataReader dr = DatabaseFactory.GetDatabase().ExecuteDataReaderSQL(sql))
                {
                    while (dr.Read())
                    {
                        North_Genre genre = new North_Genre();
                        genre = new ModelsHelper().GetNorthGenreModels(dr);
                        genres.Add(genre);
                    }
                }
            }
            catch (Exception)
            {

            }
            return genres;
        }
    }
}
